<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>


</body>
<script>
// for循环
    //打印1-100
        for(let i=1;i<101;i++){
            console.log(i); 
        }
        console.log('-----------------------------------------');
    //计算1-100之间的总和
        let sum=0;
        for(let q=1;q<101;q++){
            sum=sum+q;
        }
        console.log(sum);

    //计算1-100之间的所以的和
        for(let j=1;j<=100;j++){
            for(let y=1;y<161;y++){
                console.log(j+y);
            }
        }
        console.log('-----------------------------------------');
//while循环和do...while循环
    //打印1-160
        let i=0;
        while(i<101){
            console.log(i);
            i++;
        }	
        console.log('-----------------------------------------');
    //打印1-180的偶数
        let j=0;
        while(j<101){
            if(j%2==0){
                console.log(j);
            }
        j++;
        }
        console.log('-----------------------------------------');
    //while循环和do...while循环区别
        //while循环:条件不满足就不会执行。
        //do...while循环:条件满不满足都会执行、 
        let a=10; 
        while(a<10){
            console.log('执行while循环');
        }
        console.log('-----------------------------------------');
        let b=10; 
        do{
            console.log('执行do..,while循环');
        }while(b<10)
    //打印九九乘法表的行列 
        let str='';
        for(let q=0;q<9;q++){
            for(let i=0;i<1;i++){
                str+='';
            }
            console.log(str+'\n');
        }
    </script>
</html>